package model

import "errors"

var ErrNotFound = errors.New("Rows selectd is zero")
var ErrNotUpdated = errors.New("Rows affected by update is zero")
var ErrNotDeleted = errors.New("Rows affected by delete is zero")

var IsConstraintError = errors.New("Constraint failed")
var IsValidationError = errors.New("Validation failed")
var IsNotSingular = errors.New("Name is not singular")

type BlogExtra struct {
	Meta             []*BlogPostMetum                 `json:"meta"`
	CategoryIds      []int64                          `json:"cids"`
	TagIds           []int64                          `json:"tids"`
	SectionId        int64                            `json:"sid"`
	Terms            []*BlogTermRelationship          `json:"terms"`
	Media            []*BlogAttachmentRelationship    `json:"attachments"`
	Relations        []*BlogKnowledgeBaseRelationship `json:"relationship"`
	VersionRelations []*BlogKnowledgeBaseRelationship `json:"versionRelations"`
	Uri              string                           `json:"uri"`
	UriTemplate      string                           `json:"uriTemplate"`
	Version          string                           `json:"version"`
	ParentId         int64                            `json:"parentId"`
	DelMetaIds       []uint64                         `json:"delMetaIds"`
	DelTermIds       []uint64                         `json:"delTermIds"`
	DelMediaIds      []uint64                         `json:"delMediaIds"`
	DelRelationIds   []uint64                         `json:"delRelationIds"`
}
type BlogRel struct {
	TagIds     []uint64 `json:"tagIds"`
	DelTermIds []uint64 `json:"delTermIds"`
}

type BlogPostRel struct {
	Detail      *BlogPostDetail               `json:"detail"`
	CategoryIds []uint64                      `json:"categoryIds"`
	TagIds      []uint64                      `json:"tagIds"`
	Term        []*BlogTermRelationship       `json:"terms"`
	DelTermIds  []uint64                      `json:"delTermIds"`
	Meta        []*BlogPostMetum              `json:"meta"`
	DelMetaIds  []uint64                      `json:"delMetaIds"`
	Media       []*BlogAttachmentRelationship `json:"media"`
	DelMediaIds []uint64                      `json:"delMediaIds"`
	Blacklist   []string                      `json:"blacklist"`
}

type BlogPageRel struct {
	Detail      *BlogPageDetail               `json:"detail"`
	CategoryIds []uint64                      `json:"categoryIds"`
	TagIds      []uint64                      `json:"tagIds"`
	Term        []*BlogTermRelationship       `json:"terms"`
	DelTermIds  []uint64                      `json:"delTermIds"`
	Meta        []*BlogPageMetum              `json:"meta"`
	DelMetaIds  []uint64                      `json:"delMetaIds"`
	Media       []*BlogAttachmentRelationship `json:"media"`
	DelMediaIds []uint64                      `json:"delMediaIds"`
	Blacklist   []string                      `json:"blacklist"`
}

type KBEntryRel struct {
	Detail         *BlogKnowledgeBaseDetail         `json:"detail"`
	CategoryIds    []uint64                         `json:"categoryIds"`
	TagIds         []uint64                         `json:"tagIds"`
	SectionId      uint64                           `json:"sectionId"`
	Term           []*BlogTermRelationship          `json:"terms"`
	DelTermIds     []uint64                         `json:"delTermIds"`
	Meta           []*BlogKnowledgeBaseMetum        `json:"meta"`
	DelMetaIds     []uint64                         `json:"delMetaIds"`
	Media          []*BlogAttachmentRelationship    `json:"media"`
	DelMediaIds    []uint64                         `json:"delMediaIds"`
	Relations      []*BlogKnowledgeBaseRelationship `json:"relations"`
	Versions       []*BlogKnowledgeBaseRelationship `json:"Versions"`
	DelRelationIds []uint64                         `json:"delRelationIds"`
	Blacklist      []string                         `json:"blacklist"`
}

type BlogTermRel struct {
	Meta        []*BlogTermMetum              `json:"meta"`
	DelMetaIds  []uint64                      `json:"delMetaIds"`
	Media       []*BlogAttachmentRelationship `json:"media"`
	DelMediaIds []uint64                      `json:"delMediaIds"`
	Blacklist   []string                      `json:"blacklist"`
}
